﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace YasharEl.Infrastructure.TaskEngine.DomainModel
{
    [ContractClass(typeof(TaskRemindingManagerContract))]
    public interface ITaskRemindingManager
    {
        #region Reminder Methods

        IList<ITask> Remind(long applicationId, long userId, List<long> taskInstanceIds, DateTime returnFromPostpone, string comment);

        ITask CancelReminder(long applicationId, long userId, long taskInstanceId, string comment);

        #endregion
    }

    [ContractClassFor(typeof(ITaskRemindingManager))]
    internal abstract class TaskRemindingManagerContract : ITaskRemindingManager
    {
        public IList<ITask> Remind(long applicationId, long userId, List<long> taskInstanceIds, DateTime returnFromPostpone, string comment)
        {
            Contract.Requires<ArgumentNullException>(applicationId > 0, "applicationId must be valid positive numeric value.");
            Contract.Requires<ArgumentNullException>(userId > 0, "userId must be valid positive numeric value.");
            Contract.Requires<ArgumentNullException>(taskInstanceIds != null, "taskInstanceIds could not be empty.");
            Contract.Requires<ArgumentNullException>(returnFromPostpone != null, "returnFromPostpone could not be empty.");
            return default(List<ITask>);
        }

        public ITask CancelReminder(long applicationId, long userId, long taskInstanceId, string comment)
        {
            Contract.Requires<ArgumentNullException>(applicationId > 0, "applicationId must be valid positive numeric value.");
            Contract.Requires<ArgumentNullException>(userId > 0, "userId must be valid positive numeric value.");
            Contract.Requires<ArgumentNullException>(taskInstanceId > 0, "taskInstanceId must be valid positive numeric value.");
            return default(ITask);
        }
    }
}
